web3.js@0.2x.x web3.version.ethereum
web3.version.ethereum
Ethereum のプロトコルバージョンを返します。
非同期の場合は、次のように記述します。
web3.version.getEthereum(callback(error, result){ ... })
戻り値
String
Ethereum のプロトコルバージョン
サンプルコード
code:example.js
// 同期プログラム
var version = web3.version.ethereum;
console.log(version); // 0x3f
// 非同期プログラム
web3.version.getEthereum((error, result) => {
console.log(result);
});
動作サンプル
https://piyolab.github.io/sushiether/web3.js_v0.2x.x/web3/web3.version.ethereum/
ソースコード
https://github.com/piyolab/sushiether/blob/master/web3.js_v0.2x.x/web3/web3.version.ethereum/index.html
参考
https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionethereum
メモ
0x3f は10進数だと 63
https://github.com/ethereum/wiki/wiki/Ethereum-Wire-Protocol#fast-synchronization-pv63
Ethereum クライアントのP2P 通信のプロトコルバージョン
#todo
#Ethereumプロトコル のバージョンについてまとめる
#web3.js@0.2x.x #web3.js